<?php

namespace app\adminabc\model;

use think\Model;

class Node extends Model {
	function getAllNode() {
		return db ( 'node' )->order ( 'id desc' )->select ();
	}
	function getNode($map) {
		return db ( 'node' )->where ( $map )->order ( 'id desc' )->select ();
	}
	function nodeInfo($map) {
		return db ( 'node' )->where ( $map )->find ();
	}
	function add($data) {
		return db ( 'node' )->insertGetId ( $data );
	}
	function edit($id, $data) {
		return db ( 'node' )->where ( array ([ 'id','=',$id ] ) )->update ( $data );
	}
	function del($map) {
		return db ( 'node' )->where ( $map )->delete ();
	}
	function addAccess($data) {
		return db ( 'access' )->insertGetId ( $data );
	}
	function delAccess($map) {
		return db ( 'access' )->where ( $map )->delete ();
	}
	function AccessInfo($map) {
		return db ( 'access' )->where ( $map )->find ();
	}
}

?>